package gui.actions;

import controller.Controller;
import gui.utils.CheckBoxWithVariable;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class CheckboxAction extends AbstractAction {
	private static final long serialVersionUID = 1L;

	@Override
	public void actionPerformed(ActionEvent arg0) {
		if (arg0.getSource() instanceof CheckBoxWithVariable){
			CheckBoxWithVariable cb = (CheckBoxWithVariable) arg0.getSource();
			Controller.getInstance().checkBoxClicked(cb.getVariable(), cb.isSelected());
		}
		else {
			System.err.println("dafuq?");
		}
	}

}
